package com.ruoyi.deeplearn.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.deeplearn.mapper.DeepMarkProjectMapper;
import com.ruoyi.deeplearn.domain.DeepMarkProject;
import com.ruoyi.deeplearn.service.IDeepMarkProjectService;

/**
 * 标记项目Service业务层处理
 *
 * @author rww
 * @date 2024-08-29
 */
@Service
public class DeepMarkProjectServiceImpl implements IDeepMarkProjectService
{
    @Autowired
    private DeepMarkProjectMapper deepMarkProjectMapper;

    /**
     * 查询标记项目
     *
     * @param moduleId 标记项目主键
     * @return 标记项目
     */
    @Override
    public DeepMarkProject selectDeepMarkProjectById(Long moduleId)
    {
        return deepMarkProjectMapper.selectDeepMarkProjectById(moduleId);
    }

    /**
     * 查询标记项目列表
     *
     * @param deepMarkProject 标记项目
     * @return 标记项目
     */
    @Override
    public List<DeepMarkProject> selectDeepMarkProjectList(DeepMarkProject deepMarkProject)
    {
        return deepMarkProjectMapper.selectDeepMarkProjectList(deepMarkProject);
    }

    /**
     * 新增标记项目
     *
     * @param deepMarkProject 标记项目
     * @return 结果
     */
    @Override
    public int insertDeepMarkProject(DeepMarkProject deepMarkProject)
    {
        deepMarkProject.setId(IdUtil.getSnowflakeNextId());
        deepMarkProject.setCreateTime(DateUtils.getNowDate());
        return deepMarkProjectMapper.insertDeepMarkProject(deepMarkProject);
    }

    /**
     * 修改标记项目
     *
     * @param deepMarkProject 标记项目
     * @return 结果
     */
    @Override
    public int updateDeepMarkProject(DeepMarkProject deepMarkProject)
    {
        deepMarkProject.setUpdateTime(DateUtils.getNowDate());
        return deepMarkProjectMapper.updateDeepMarkProject(deepMarkProject);
    }

    /**
     * 批量删除标记项目
     *
     * @param moduleIds 需要删除的标记项目主键
     * @return 结果
     */
    @Override
    public int deleteDeepMarkProjectByIds(Long[] moduleIds)
    {
        return deepMarkProjectMapper.deleteDeepMarkProjectByIds(moduleIds);
    }

    /**
     * 删除标记项目信息
     *
     * @param moduleId 标记项目主键
     * @return 结果
     */
    @Override
    public int deleteDeepMarkProjectById(Long moduleId)
    {
        return deepMarkProjectMapper.deleteDeepMarkProjectById(moduleId);
    }
}
